# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=jeb-intel
pkgver=3.0.3.201809240610
pkgrel=1
epoch=1
pkgdesc='Intel decompiler.'
arch=('any')
groups=('blackarch' 'blackarch-reversing')
url='https://www.pnfsoftware.com/jeb/intel'
depends=('java-environment' 'java-runtime-common')
source=('https://www.pnfsoftware.com/dl?jebdemox86')
sha512sums=('7d8d044f90d7b3d2ea01c1db84a5f9d7f78dbe67dcd06b4deabf61ab521c0d06c8a9334334eb150988751dd376047230fa92115f719ba42c00b94a7a1b089507')

pkgver() {
  cat bin/VERSION.TXT
}

package() {
  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/opt/$pkgname"

  rm -rf 'dl?jebdemox86'

  cp --no-preserve=ownership -r * "$pkgdir/opt/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /opt/$pkgname
exec ./jeb_linux.sh "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

